# Phase 2 

phase2_intro:
.asciiz "\nWelcome to Phase 2, in this phase you will write all of the code to build the MIPS CPU, but don't worry about it too much because all of your code will be re-written in phase 3."

writingCode:
.asciiz "\nWhile working on your code, you come across an error in your code, do you:\n1. Write proper and commented code from the beginning.\n2. Debug and fix the problem.\n3. Let the integration team worry about it later."

integrationOverlord:
.asciiz "\nA ravenous Integration Overlord appears and deal 1337 damage... you be dead\nNobody Expects the Spanish Integration, Nobody!" 
#mother fucker got himself killed 

phase_two_begin:
	li $a0, phase2_intro
	jal libplp_uart_write_string
	nop

#Select Group title
	phase2_job:
	li $a0, team_pos
	jal libplp_uart_write_string
	nop
		
	#read in user's selection for RPS
	jal libplp_uart_read
	nop
		
		
	#check for which team
	li $t0, 0x00000001
	beq $s6, $t0, meta_phase2
	nop
	li $t0, 0x00000002
	beq $s6, $t0, front_phase2
	nop
	li $t0, 0x00000003
	beq $s6, $t0, haz_phase2
	nop
	li $t0, 0x00000004
	beq $s6, $t0, ex_phase2
	nop
	li $t0, 0x00000005
	beq $s6, $t0, test_phase2
	nop
	
meta_phase2:
	jal phase2_meta_start
	nop

front_phase2:
	jal phase2_front_start
	nop
	
haz_phase2:
	jal phase2_haz_start
	nop
	
ex_phase2:
	jal phase2_ex_start
	nop

test_phase2:
	jal phase2_test_start
	nop
	
integtrationStall:
	li $a0, writingCode
	jal libplp_uart_write_string

	#check for bad idea
	li $t0, 0x00000003
	beq $s6, $t0, overdeath
	nop

overdeath:
	li $a0, integrationOverlord
	jal libplp_uart_write_string
	nop
	j start
	nop

	
# Add some more stuff and eventually make it somehow to phase 3...
	
	